//
// Created by dwx on 2024/3/30.
//
#include "rtthread.h"
#include "bsp_all.h"


extern uint8_t ChargSta;
void led_entry(void *arg){
    while(1){
        //WS281x_Rainbow(5);
        WS281x_RainbowCycle(1);
       // HAL_UART_Transmit(&huart2, "CLR(3);\r\n", 10, 1);

        rt_thread_mdelay(1);
    }
}


void systemprintf(void *arg){
    uint16_t cnt = 0;
    while(1){

            rt_kprintf("test:%d\r\n",__HAL_TIM_GET_COUNTER(&htim3));

        rt_thread_mdelay(100);
    }
}

void lcd_entry(void *arg){
    uint16_t cnt = 0;
    lcd_printf("CLR(4);\r\n");
    while(1){

        if(cnt++>=100) {
            cnt = 0;
            if (HAL_GPIO_ReadPin(ChargeSta_GPIO_Port,ChargeSta_Pin)) {
                lcd_printf("CLR(4);DC32(161,281,'%d',0);\r\n", 0);
            } else {

                lcd_printf("CLR(4);DC32(161,281,'%d',0);\r\n", 1);

            }
        }

        rt_thread_mdelay(1);
    }
}